package com.symone.webcms.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 *   @description : LoginLog 实体类
 *   ---------------------------------
 * 	 @author Archer Chu
 *   @since 2018-11-18
 */
@Data
@Accessors(chain = true)
@TableName("sys_login_log")
public class LoginLog extends Model<LoginLog> {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
	@ApiModelProperty("ID")
	@TableId(value="id", type= IdType.AUTO)
	private Long id;
    /**
     * 登录名
     */
	@ApiModelProperty("登录名")
	@TableField("login_name")
	private String loginName;
    /**
     * 登录密码
     */
	@ApiModelProperty("登录密码")
	@TableField("login_password")
	private String loginPassword;
    /**
     * IP地址
     */
	@ApiModelProperty("IP地址")
	@TableField("ip_address")
	private String ipAddress;
    /**
     * URL
     */
	@ApiModelProperty("URL")
	private String url;
    /**
     * 参数
     */
	@ApiModelProperty("参数")
	private String params;
	/**
	 * 操作系统
	 */
	@ApiModelProperty("操作系统")
	private String os;
	/**
	 * 操作系统
	 */
	@ApiModelProperty("设备类型")
	private String device;
    /**
     * 浏览器
     */
	@ApiModelProperty("浏览器")
	private String browser;
    /**
     * USER-AGENT
     */
	@ApiModelProperty("USER-AGENT")
	@TableField("user_agent")
	private String userAgent;
    /**
     * 登录结果(1,成功;)
     */
	@ApiModelProperty("登录结果(1,成功;)")
	private Integer state;
	private String memo;
	private Integer deleted;
	@TableField("create_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}
